home *** CD-ROM | disk | FTP | other *** search
/ Java Programmer's Toolkit / Java Programmer's Toolkit.iso / gs3.53 / devices.doc < prev    next >
Text File  |  1996-01-10  |  82KB  |  1,756 lines

  1.    Copyright (C) 1992, 1995 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of Aladdin Ghostscript.
  4.   
  5.   Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  9.   License (the "License") for full details.
  10.   
  11.   Every copy of Aladdin Ghostscript must include a copy of the License,
  12.   normally in a plain ASCII text file named PUBLIC.  The License grants you
  13.   the right to copy, modify and redistribute Aladdin Ghostscript, but only
  14.   under certain conditions described in the License.  Among other things, the
  15.   License requires that the copyright notice and this notice be preserved on
  16.   all copies.
  17.  
  18. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  19.  
  20. This file, devices.doc, gives more detailed documentation about
  21. certain specific devices for which Ghostscript can produce output.
  22.  
  23. For an overview of Ghostscript and a list of the documentation files, see
  24. README.
  25.  
  26. Devices for which this file currently contains documentation:
  27.     SPARCprinter
  28.     HP DeskJet 520, 540, and 560C
  29.     HP DeskJet 500C & 550C
  30.     HP PaintJet, XL, and XL300
  31.     DEC LJ250
  32.     Apple Dot Matrix Printer (and Imagewriter)
  33.     Epson Stylus Color Printer
  34.     Canon BJC-600/BJC-4000 and BJC-800 BubbleJet Color Printers
  35.  
  36. ### ------------------------- The SPARCprinter ------------------------- ###
  37.  
  38. This section was written by Martin Schulte.
  39.  
  40. Introduction
  41. ------------
  42.  
  43. The SPARCprinter is is connected to SPARCStation via a special SBUS card's
  44. video inferface, the picture is composed on the host and only a bitmap is
  45. send to the printer unit.
  46.  
  47. Together with a SPARCprinter, you always buy (as far as I know) software
  48. that enables you to do postscript-printing on your SPARCPrinter.
  49.  
  50. So, the need for a Ghostscript-Interface to the SPARCPrinter seems low,
  51. but on the other hand some Postscript drawings are not correctly printed
  52. with SUN's software: on some pages occured a thin vertical line of rubbish
  53. (reproducable), on some Mathematica drawings the text at the axes wasn't
  54. rotated.
  55.  
  56. I tried all of these with Ghostscript and always got the expected results.
  57.  
  58. However, replacing proprietary software should never be a bad idea.
  59.  
  60. The problem is that there has yet been no effort to make the SPARCPrinter-
  61. driver behave like a BSD output-filter, I made my tests using the script
  62. mentioned under Installation.
  63.  
  64. Installation
  65. ------------
  66.  
  67. Add sparc.dev to DEVICE_DEVS and compile ghostscript as described in
  68. make.doc.
  69.  
  70. Afterwards, you can use the following script (the way of handling standard
  71. input versus filename-arguments doesn't look very clever, has anyone a
  72. better idea ?) to print if you substitute <GSPATH> by the place where you
  73. installed the ghostscript binary:
  74.  
  75. outcmd1='/vol/local/lib/troff2/psxlate -r'
  76. outcmd2='<GSPATH> -I/home/schulte/gs252 -sDEVICE=sparc -sOUTPUTFILE=/dev/lpvi0 -'
  77.  
  78. if [ $# -eq 0 ]
  79. then
  80.   $outcmd1 | $outcmd2
  81. else
  82.   cat $* | $outcmd1 | $outcmd2
  83. fi
  84.  
  85. Problems
  86. --------
  87.  
  88. Since /dev/lpvi can only be opened for exclusive use, another job having
  89. opened it (engine_ctl_sparc or another ghostscript as the most probable
  90. canidates) will cause to stop ghostscript with "Error: /invalidfileaccess
  91. in --.outputpage--"
  92.  
  93. In case of common printer problems like out of paper, a warning describing
  94. the reason will be printed to stdout, the driver will try to access again
  95. and again each five seconds.
  96.  
  97. Due to a problem with the device-driver (in the kernel) the reason of
  98. printer failure is not always correctly reported to program.  This is the
  99. case at least if you open the top cover (Error in the display: E5).  Look
  100. to the display at the printer if a "Printer problem with unknown reason"
  101. is reported.
  102.  
  103. Fatal errors will cause the print-job to be terminated.
  104.  
  105. ### ------------------------------ End --------------------------------- ###
  106.  
  107. ### ------------------- H-P color inkjet printers ---------------------- ###
  108. ###  (DeskJet 500C, DeskJet 550C, PaintJet, PaintJet XL, PaintJet XL300  ###
  109. ###  and the DEC LJ250 which can operate in a Paintjet-compatible mode)  ###
  110.  
  111. This section was written by George Cameron.
  112.  
  113. Information and tips on usage for the drivers contained in gdevcdj.c
  114. ====================================================================
  115.  
  116. OVERVIEW:
  117.  
  118. There are 6 generic drivers contained in the source module:
  119.  
  120.      1 - cdj500:      HP DeskJet 500C and 540C
  121.      2 - cdj550:      HP DeskJet 550C and 560C
  122.      3 - pjxl300:     HP PaintJet XL300 and DeskJet 1200C
  123.      4 - pjtest:      HP PaintJet
  124.      5 - pjxltest:    HP PaintJet XL
  125.      6 - declj250:    DEC LJ250
  126.  
  127.  All of these drivers have 8-bit (monochrome), 16-bit and 24-bit
  128.      (colour) and for the DJ 550C 32-bit, (colour, cmyk mode)
  129.      options in addition to standard colour and mono drivers.
  130.  It is also possible to set various printer-specific parameters
  131.      from the gs command line, eg.
  132.  
  133.   gs -sDEVICE=cdeskjet -dBitsPerPixel=16 -dDepletion=1 -dShingling=2 tiger.ps
  134.  
  135. NB/ The old names cdeskjet, cdjcolor and cdjmono drivers have been retained;
  136.     however, their functionality duplicates that available using the above
  137.     drivers (and cdeskjet is identical to cdj500), ie. we can use:
  138.  
  139.     gs -sDEVICE=cdj500 -dBitsPerPixel=24 ...    for cdjcolor, and
  140.     gs -sDEVICE=cdj500 -dBitsPerPixel=1  ...    for cdjmono
  141.  
  142.  
  143. DEFAULT PAPER SIZE:
  144.  
  145.  If the preprocessor symbol A4 is defined, the default paper size is the
  146.  European A4 size; otherwise it is the U.S. letter size (8.5"x11"). Other
  147.  paper sizes (including A3 for the PaintJet XL and PaintJet XL300) may be
  148.  specified on the command line as explained in the Ghostscript documentation.
  149.  
  150.  
  151. DEFAULT BITS-PER-PIXEL:
  152.  
  153.  If the preprocessor symbol BITSPERPIXEL is defined as an integer (see below
  154.  for the range of allowable values), this number will be used to define the
  155.  default bits-per-pixel (ie. bit depth) for the generic drivers. If the
  156.  symbol is not defined, the default is set to 24 bits per pixel. It is
  157.  of course still possible to specify the value from the command line, as
  158.  described below. Note also that the cdeskjet, cdjcolor and cdjmono
  159.  drivers are unaffected by setting this symbol, as their default settings
  160.  are predefined to be 1, 3 and 24 respectively.
  161.  
  162.  
  163. DESKJET PHYSICAL LIMITS:
  164.  
  165.  Maximum printing width = 2400 dots = 8". The printer manuals say that the
  166.  maximum recommended printing height on the page is 10.3", but since this
  167.  is obviously not true for A4 paper, and I have been unable to detect any
  168.  problems in printing longer page lengths, this would seem to be a rather
  169.  artificial restriction.
  170.  
  171.  All Deskjets have 1/2" unprintable bottom margin, due to the mechanical
  172.  arrangement used to grab the paper. Side margins are approximately 0.25"
  173.  for US Letter paper, and 0.15" for A4.
  174.  
  175.  
  176. COMMAND LINE PARAMETERS:
  177.  
  178.  Several printer 'properties' have been implemented for these printers.
  179.  Those available so far are all integer quantities, and thus may be
  180.  specified as eg.
  181.  
  182.     gs -dBitsPerPixel=32 -dShingling=1 ... 
  183.  
  184.  which sets the BitsPerPixel parameter to 32 and the Shingling parameter
  185.  to 1.
  186.  
  187.  
  188. BITS-PER-PIXEL:
  189.  
  190.  All of the drivers in gdevcdj.c accept a command line option to set the
  191.  BitsPerPixel property. This gives considerable flexibility in choosing
  192.  various trade-offs between speed/quality/colour etc. The valid numbers
  193.  are:
  194.  
  195.     1:    This is a standard Ghostscript monochrome driver, and uses
  196.         black ink (by installing the separate mono cartridge in
  197.         the case of the DeskJet 500C, or automatically for the
  198.         other printers)
  199.  
  200.     3:    A standard Ghostscript colour driver, using internal
  201.         dithering. This is fast to compute and to print, but
  202.         the clustered dithering can lose some detail and
  203.         colour fidelity.
  204.  
  205.     8:    An 'error-diffusion' monochrome driver which uses
  206.         Floyd-Steinberg dithering to print greyscale images.
  207.         The patterns are much more randomised than with the
  208.         normal clustered dithering, but the data files can
  209.         be much larger and somewhat slower to print.
  210.  
  211.     16:    This is a 'cheaper' version of the following (24-bit)
  212.         driver, which generates a Floyd-Steinberg colour dithered
  213.         output using the minimum amount of memory (this may be
  214.         helpful when using IBM PC's when Ghostscript has not
  215.         been compiled using a 32-bit 386-style compiler). The
  216.         quality can be almost as good as the 24-bit version.
  217.  
  218.     24:    A high-quality colour driver using Floyd-Steinberg dithering
  219.         for maximum detail and colour range. However it is very
  220.         memory intensive and thus can be slow to compute (and it
  221.         tends to produce rather larger raw data files, so they
  222.         can also be slower to print).
  223.  
  224.     32:    This is for the DeskJet 550C only, which uses the black
  225.         cartridge and the colour cartridge simultaneously (ie.
  226.         CMYK printing). This printer can be both faster and give
  227.         higher quality than the DeskJet 500C, because of the
  228.         true black ink. (Note that the 24-bit mode also permits
  229.         CMYK printing on this printer, and uses less memory. Any
  230.         differences between 24-bit and 32-bit should be very small.)
  231.  
  232.  
  233. DESKJET PROPERTIES:
  234.  
  235.  The addional properties available for the DeskJets are:
  236.  
  237.     BlackCorrect    (int)      /* Colour correction to give
  238.                    * better blacks when using the DJ500C
  239.                    * in colour mode, eg. the default of 4
  240.                    * reduces the cyan component to 4/5 
  241.                    * Range accepted: 0 - 9 (0 = none) */
  242.     Shingling    (int)      /* Interlaced, multi-pass printing 
  243.                                * 0 = none, 1 = 50%, 2 = 25%, 2 is
  244.                    * best & slowest */
  245.     Depletion    (int)      /* 'Intelligent' dot-removal 
  246.                            * 0 = none, 1 = 25%, 2 = 50%, 1 best
  247.                    * for graphics? 
  248.                    * Use 0 for transparencies */
  249.  
  250. PAINTJET XL300/PAINTJET XL PROPERTIES:
  251.  
  252.     PrintQuality    (int)      /* Mechanical print quality
  253.                    * -1 = fast, 0 = normal, 1 = presentation
  254.                    * Fast mode reduces ink usage and uses
  255.                    * single-pass operation for some media
  256.                    * types. Presentation uses more ink and
  257.                    * max number of passes, ie. slowest
  258.                    * printing for highest quality */
  259.     RenderType    (int)      /* 0 = driver does dithering
  260.                    * 1 = snap to primaries
  261.                    * 2 = snap black -> white, others to black
  262.                    * 3 = ordered dither
  263.                    * 4 = error diffusion
  264.                    * 5 = monochrome ordered dither
  265.                    * 6 = monochrome error diffusion
  266.                    * 7 = cluster ordered dither
  267.                    * 8 = monochrome cluster ordered dither
  268.                    * 9 = user-defined dither (not supported)
  269.                    * 10 = monochrome user-defined dither ns. */
  270.  
  271. PAINTJET PROPERTIES:
  272.  
  273.     No additional properties
  274.  
  275.  
  276. GAMMA CORRECTION:
  277.  
  278.  One consequence of using Floyd-Steinberg dithering rather than Ghostscript's
  279.  default clustered ordered dither is that it is much more obvious that the
  280.  ink dots are rather larger on the page than their nominal 1/180" or 1/300"
  281.  size (clustering the dots tends to minimise this effect). Thus it is often
  282.  the case that the printed result is rather too dark. A simple empirical
  283.  correction for this may be achieved by preceding the actual postscript
  284.  file to be printed by a short file which effectively sets the gamma for
  285.  the device, eg.
  286.  
  287.  gs ... gamma.ps colorpic.ps -c quit
  288.  
  289.  where gamma.ps is
  290.  
  291. %!
  292. {0.333 exp} dup dup currenttransfer setcolortransfer
  293.  
  294.  This example sets the gamma for r, g, and b to 3, which seems to work
  295.  reasonably well in practice.
  296.  
  297.  
  298. GENERAL TIPS:
  299.  
  300.  For all the above printers, the paper is critically important to the 
  301.  final results. Smoother, less fibrous paper is generally better (and
  302.  suggested types are given in the printer manuals). In particular, the
  303.  special ink-jet paper can make a big difference; the colours are 
  304.  brighter, but most importantly, there is almost no colour bleed, even 
  305.  with adjacent areas of very heavy inking. Similarly, the special coated
  306.  transparencies also work well (and ordinary transparencies do not work
  307.  at all!)
  308.  
  309.  The unix-lpr.sh provides one example of setting up a multi-option
  310.  colour postscript lpr queue on Unix systems, and includes the ability
  311.  to choose a range of different colour options and printer accounting
  312.  and error logging.
  313.  
  314.  
  315. CAVEAT EMPTOR!:
  316.  
  317.  It is not always easy for me to test all of these drivers, as the only
  318.  colour printer I have here is the DeskJet 500C. I rely on others testing
  319.  drivers for the additional machines and reporting their findings back to
  320.  me. 
  321.  
  322. HP's 600x300 dpi resolution-enhanced mode for inkjet printers
  323. =============================================================
  324.  
  325. This feature is available on HP's more recent inkjet printers,
  326. including the Deskjet 520 (mono) 540 (mono or colour) and 560C (mono
  327. and colour).
  328.  
  329. The colour and monochrome drivers for the HP deskjet 550c are
  330. (probably) the best you will get for use with ghostscript, for the
  331. following reasons:
  332.  
  333. These printers do not offer true 600x300 dpi resolution. Those that
  334. print in colour are strictly 300x300 dpi in colour mode, while in mono
  335. mode there is a pseudo 600x300 dot mode, with the restriction that you
  336. can't print two adjacent dots. Thus, in effect what you have is 600 dpi
  337. dot positioning, but on average you don't get more dots per line.
  338.  
  339. What this does give is the possibility to have eg. sharper character
  340. outlines, as you can place dots on the edges nearer to their ideal
  341. positions - this is why it is worth doing.
  342.  
  343. However, HP will not support user-level programming of this
  344. resolution-enhanced mode, one reason being that (I understand) all the
  345. dot spacing has to be done by the driver, and if you get it wrong, you
  346. can actually damage the print head.
  347.  
  348. To summarise, you may lose a smidgin of (potential) text clarity using
  349. the 550c drivers (cdj550, cdjcolor, cdjmono etc.), but other than that,
  350. they are the ones for the job.
  351.  
  352. ### ------------------------------ End --------------------------------- ###
  353.  
  354. ### ------------------- Apple Dot Matrix Printer  ---------------------- ###
  355.  
  356. This section was written by Mark Wedel.
  357.  
  358.  The Dot Matrix Driver (DMP) driver is a simple driver I wrote.  It
  359. could more more efficient, but it seems to print the images fine.
  360.  
  361.  The Dot Matrix Printer was a parallel predecessor to the Imagewriter
  362. printer.  As far as I know, the Imagewriter commands are a superset
  363. to those of the Dot Matrix printer, so the driver should work fine at
  364. generating output that can be printed on Imagewriters.
  365.  
  366.  A few notes (from the gdevadmp.c file):
  367.  
  368.  * To print out images, it sets the printer for unidirection printing
  369.  * and 15 cpi (120 dpi). IT sets line feed to 1/9 of an inch (72 dpi).
  370.  * When finished, it sets things back to bidirection print, 1/8" line
  371.  * feeds, and 12 cpi.  There does not appear to be a way to reset
  372.  * things to initial values.
  373.  *
  374.  * This code does not set for 8 bit characters (which is required). It
  375.  * also assumes that carriage return/newline is needed, and not just
  376.  * carriage return.  These are all switch settings on the DMP, and
  377.  * I have configured them for 8 bit data and cr only.
  378.  *
  379.  * You can search for the strings Init and Reset (in devdemp.c) to find the
  380.  * strings that set up the printer and clear things when finished, and change
  381.  * them to meet your needs.
  382.  *
  383.  * Also, you need to make sure that the printer daemon (assuming unix)
  384.  * doesn't change the data as it is being printed.  I have set my
  385.  * printcap file (sunos 4.1.1) with the string:
  386.  * ms=pass8,-opost
  387.  * and it works fine.
  388.  
  389.  Mark Wedel
  390. master@cats.ucsc.edu
  391.  
  392. ### ------------------------------ End --------------------------------- ###
  393.  
  394. ### ------------------ The Epson Stylus Color printer ------------------ ###
  395. /*
  396.  Epson Stylus-Color Driver, contributed by Gunther Hess (address: see below)
  397.  
  398. I N T R O D U C T I O N
  399. =======================
  400. This documentation accompanies version 1.20 of the stcolor-driver.
  401. The new feature of this version is the support of deltarow encoding
  402. and some new parameters for direct control of the ESC/P2-Output.
  403. In comparison to the previous public distributed version (1.12) it is
  404. almost a new driver.
  405.  
  406. Uff, stcinfo.ps finally made it into this release. For those of you,
  407. who work with a ColorAdjustMatrix: The left Color-Triangle is
  408. created without the ColorAdjustMatrix and the Color-Bars with the 
  409. primary colors ignore this Matrix too.
  410.  
  411. U S A G E
  412. =========
  413. This driver is selected with "-sDEVICE=stcolor" and produces output for an
  414. Epson Stylus-Color at 360DpI resolution by default, but it can do much
  415. more with this printer and with significantly better quality, than with
  416. the default-mode and it can also produce code for the monochrome-versions
  417. of this printer.
  418.  
  419. This can be achieved either via command-line options or via ghostscript-input.
  420. For convienience a Postscript-File is supplied, that can be used as initial
  421. inputfile. Thus, assumed that ghostscript is invoked via "gs" on your computer,
  422. try the following command:
  423.  
  424.     gs -sDEVICE=stcolor -rXDPIxYDPI stcolor.ps ... (e.g.: your input-files)
  425.  
  426. were XDPI is one of 180/360/720 and YDPI is one of 90/180/360/720. The result
  427. should be significantly better, you may use "stcolor.ps" with other devices
  428. too, but I do not recommend this, since it does nothing then. "stcolor.ps"
  429. should be available with binary distributions and should reside in the
  430. ghostscript input-directory. Thus if ghostscript is part of your
  431. printer-spooler, you can insert
  432.  
  433.     (stcolor.ps) findlibfile { pop run } if pop
  434.  
  435. to the files you want to run through the improved algorithms and you may want
  436. to adapt this file to your specific needs. The methods and options for this
  437. are described here, but this description is restricted to the gs-options, while
  438. their manipulation at the Postscript-level is documented in "language.doc" and
  439. in the mentioned "stcolor.ps".
  440.  
  441. Next thing is to explain the options (as written on my unix-system).
  442. The order is somehow related to their use during the printing-Process:
  443.  
  444.   -dUnidirectional      - Force unidirectional printing,
  445.                           recommended for transparencies
  446.  
  447.   -dMicroweave          - enable the printers "microweave"-feature
  448.                           (the driver does weaving internally by default,
  449.                            which can be applied to more X/Ydpi-combinations
  450.                            and weaving by the driver reduces execution-time)
  451.  
  452.   -dnoWeave             - disable any Weaving, overrides -dMicroweave
  453.                           (Try it to see the effect of weaving - you won't
  454.                            use this option again)
  455.  
  456.   -sDithering="name"    - select another dithering-algorithm, available are:
  457.               "gscmyk"    : fast color-output, with CMYK-ProcessColorModel [D]
  458.               "gsmono"    : fast black & white output
  459.               "gsrgb"     : fast color-output, with RGB-ProcessColorModel
  460.               "fsmono"    : Floyd-Steinberg, Monochrome
  461.               "fsrgb"     : Floyd-Steinberg, with RGB-ProcessColorModel
  462.                             (Almost identical to cdj550/mjcxxx-Algorithm)
  463.               "fsx4"      : Floyd-Steinberg, with CMYK-ProcessColorModel
  464.                             (shares code with fsmono & fsrgb, but is
  465.                              algorithmically really bad)
  466.               "fscmyk"    : Floyd-Steinberg, with CMYK-ProcessColorModel
  467.                             and proper modifications for CMYK
  468.               "hscmyk"    : modified Floyd-Steinberg with CMYK-Model
  469.                             ("hs" stands for "hess" nor for "high speed",
  470.                              but the major difference to "fscmyk" is speed)
  471.               "fs2"       : algorithm by Steven Singer (RGB)
  472.                             should be identical to escp2cfs2.
  473.  
  474.  -dBitsPerPixel=1...32    - number of bits used for pixel-storage, the larger
  475.                             the value, the better the quality - at least in
  476.                             theory. In fsrgb one can gain some speed, when
  477.                             restricting to 24 Bits, rather than the default
  478.                             of 30.
  479.  
  480.  -dFlag0                  - causes some algorithms to select a uniform
  481.                             initialisation rather than a set of random-values.
  482.                             May yield "sharper" image-impression at the
  483.                             cost of "dithering-atrefacts".
  484.                             (applies to hscmyk and all fs-modi, except for fs2,
  485.                              which always uses a constant initialization.)
  486.  
  487.  -dFlag1 ... -dFlag4      - available to future algorithms.
  488.  
  489.  -dColorAdjustMatrix={3/9/16 x float}'
  490.                           - This is a Matrix to adjust the colors. Values should
  491.                             be between -1.0 and 1.0, and the number of
  492.                             values depend on the colormodel used by the
  493.                             selected algorithm. In RGB- and CMYK-modi a matrix
  494.                             with 1.0 on the diagonal produces no transformation.
  495.                             (I could not identify a similar feature at the
  496.                             language-level, so this option was implemented, it
  497.                             is really required, but I don't know reasonable
  498.                             values yet.)
  499.  
  500.  -dCtransfer='{float float ...}', -dMtransfer=..., -dY..., -dK... or
  501.  -dRtransfer='{float float ...}', -dG..., -dB... or
  502.  -dKtransfer='{float float ...}'
  503.                           - which is used, depends on the algorithm, which
  504.                             maybe either either CMYK, RGB or monochrome.
  505.                             The values are arrays of floats in the range from
  506.                             0 to 1.0, which represent the visible
  507.                             color-intensity for the device. One may achieve
  508.                             similar effects with "setcolortransfer" at the
  509.                             language-level, but this takes more time and the
  510.                             underlying-code for the driver-specific parameters
  511.                             is still required. The size of the arrays is
  512.                             arbitrary and the defaults are {0.0 1.0}, which
  513.                             is a linear characteristic, most of the code in
  514.                             "stcolor.ps" are better transfer-arrays.
  515.  
  516.  -dKcoding='{float...}', -dC..., -dM... etc.
  517.                           - this are again arrays between 0.0 and 1.0, and
  518.                             they control the internal coding of the
  519.                             color-values. Clever usage of this arrays may
  520.                             yield further enhancements, but no experience yet.
  521.  
  522.  -dColorAdjustMatrix={3/9/16 x float}'
  523.                           - This is a Matrix to adjust the colors. Values should
  524.                             be between -1.0 and 1.0, and the number of
  525.                             values depend on the colormodel used by the
  526.                             selected algorithm. In RGB- and CMYK-modi a matrix
  527.                             with 1.0 on the diagonal produces no transformation.
  528.                             (I could not identify a similar feature at the
  529.                             language-level, so this option was implemented, it
  530.                             is really required, but I don't know reasonable
  531.                             values yet.)
  532.  
  533.  -sModel=st800            - causes output to be suitable for the monochrome
  534.                             Stylus 800 (no Weaving, no Color).
  535.  
  536.  -sOutputCode=            - can be either "deltarow", "plain" or "runlength"
  537.                             and changes the ESC/P2 (TM) coding-technique used
  538.                             by the driver. The default is to use the
  539.                             runlength-encoding. "plain" selects uncompressed
  540.                             encoding and yields enormeous amounts of data to
  541.                             generated, while "deltarow" allows for
  542.                             2D-compression, may reduce size of the data and
  543.                             printing speed. But there is a *WARNING*
  544.   *WARNING* *WARNING*:      "deltarow" sometimes causes really bad hangs
  545.                             on my printer. Conditions do not depend on the
  546.                             data: sometimes times the same ESC/P2 prints well.
  547.                             Thus "rle" seems to be adequate.
  548.  
  549.  -descp_Band=1/8/15/24    - Number of Nozzles of scanlines used in printing.
  550.                             Useful only with -dnoWeave, thus almost useless.
  551.  
  552.  -descp_Width=            - Number of Pixels Printed in each scan-Line.
  553.                             (Useful when tuning Margins only, se below)
  554.  
  555.  -descp_Height=           - Length of the entire Page in Pixels
  556.                             (Parameter of "ESC(C" in default initialization)
  557.  
  558.  -descp_Top=              - Top-Margin in scanlines.
  559.                             (1st Parameter of "ESC(c" in default initialization)
  560.  
  561.  -descp_Bottom=           - Bottom-Margin in scanlines.
  562.                             (2nd Parameter of "ESC(c" in default initialization)
  563.  
  564.  -sescp_Init="..."        - Override for the initialization-Sequence.
  565.                             (Must set Graphics-Mode-1 & Units)
  566.  
  567.  Valid Resolutions:
  568.    -r180x90, -r180x180, -r180x360,    -r180x720
  569.    -r360x90, -r360x180, -r360x360(D), -r360x720
  570.    -r720x90, -r720x180, -r720x360,    -r720x720
  571.  
  572.  Valid Option Combinations: (Setting them is *NOT* required, driver knows this)
  573.             escp_Band   ?Weave    escp_Band/#Passes
  574.    180x 90  15         no-Weave
  575.    180x180  1 , 8, 24  no/u-Weave      15/2 sWeave
  576.    180x360                             15/4 sWeave
  577.    180x720                             15/8 sWeave
  578.    360x 90  15         no-Weave
  579.    360x180  1,  8, 24  no/u-Weave      15/2 sWeave
  580.    360x360  1,  8, 24  no/u-Weave      15/4 sWeave
  581.    360x720                             15/8 sWeave
  582.    720x 90  15         no-Weave
  583.    720x180                             15/2 sWeave
  584.    720x360                             15/4 sWeave
  585.    720x720  1          no/u-Weave      15/8 sWeave
  586.  
  587.  
  588. *************************************************************************
  589. *************************************************************************
  590. **                                                                     **
  591. Å**  BEWARE: There are only few validity-checks for parameters. A good **
  592. **          example is "escp_Band": if you set this, the driver tries  **
  593. **          to use your value, even if this value is not supported by  **
  594. **          the printer:                                               **
  595. **                                                                     **
  596. **                     YOU ASKED FOR IT, AND YOU GOT IT!               **
  597. **                                                                     **
  598. *************************************************************************
  599. *************************************************************************
  600.  
  601.  
  602. A P P L I C A T I O N  - N O T E
  603. ================================
  604.  
  605. Quite a bunch of Parameters. Hopefully you never need any of them, besides
  606. feeding "stcolor.ps" to ghostscript in front of your input.
  607.  
  608. If you want to improve color, you may need to deal with the appropiate
  609. parameters, please read the chapter about color adjustment. But
  610. propably a sound background in color-models is required for that too.
  611. (If you are such a guru, your help is welcome!)
  612.  
  613. One thing, that at least bothers me, are wrong margins or a too much
  614. restricted print-area on the page. I definitely was unable to provide
  615. a general solution for the Stylus Color and there are new Models up-
  616. coming. Thus I decided to provide a maximum degree of freedom to the
  617. ghostscript-user. That is what all the escp_-Stuff is meant for.
  618. In Addition you may need the Standard-Parameters:
  619.  
  620.  PageSize             - Two Floats Entire Page-Width & Height in 1/72"
  621.  .HWMargins           - four floats Left, Bottom, Right and Top-Margins 1/72"
  622.  Margins              - Two Integers, Negative, Left & Top Margin in Pixels.
  623.                         (Adjusts the CTM so, that 1st Pixel of 1st Scan
  624.                          matches the top-left Position on the Page)
  625.  
  626. Proably you should try MicroWeave or noWeave prior to Softweave,
  627. with new printers. This mode is documented in the german owner's
  628. maunual only. So now let's wait for Epson's 3600DpI-Printer. The
  629. Driver is already capable of supporting it.
  630.  
  631.  
  632. A C K N O W L E D G E M E N T S
  633. ===============================
  634.  
  635. This driver was "copied" from gdevcdj.c (ghostscript-3.12), which was
  636. contributed by:
  637.     George Cameron      - g.cameron@biomed.abdn.ac.ukis
  638.     Koert Zeilstra      - koert@zen.cais.com
  639.     Eckhard Rueggeberg  - eckhard@ts.go.dlr.de
  640.  
  641. Some of the ESC/P2-code was drawn from gdevescp.c, contributed by
  642.     Richard Brown       - rab@physics.unimelb.EDU.AU
  643.  
  644. And several improvements are based on discussions with
  645.     Brian Converse      - ag899@osfn.rhilinet.gov
  646.     Gero Guenther       - gero@cs.tu-berlin.de
  647.     Jason Patterson     - jasonp@fit.qut.edu.au
  648.     ? Rueschstroer      - rue@ibe.med.uni-muenchen.de
  649.     Steven Singer       - S.Singer@ph.surrey.ac.uk
  650.  
  651. While I wish to thank all this people mentioned above, they are by no means
  652. responsible for bugs in the stcolor-driver - just for the features.
  653.  
  654. Duisburg 24-SEP-1995, Gunther Hess
  655.  
  656. up to sometime E-Mail:  hess@ims.fhg.de
  657. After that time, one should use snail-mail or phone:
  658.  
  659. Gunther Hess                  phone: ++49 203 376273
  660. Richard Wagner Strasse 112
  661. D-47057 Duisburg
  662. Germany
  663.  
  664. R E C O M M E N D A T I O N S
  665. =============================
  666.  
  667. The next section is a contribution from Jason Patterson <jasonp@fit.qut.edu.au>,
  668. who evaluated a previous version (1.17). GhostScript was invoked as follows:
  669.  
  670.    gs -sDEVICE=stcolor [-r720x720] -sDithering=... -sOutputFile=escp.out \
  671.       stcolor.ps whatsoever.ps
  672.  
  673. where "..." is the name of the desired algorithm. "stcolor.ps" was omitted
  674. for the gs-algorithms (gsmono, gsrgb and gscmyk), for which it is useless
  675. *and* it would not allow the selection of "gscmyk".
  676.  
  677. So here comes a very truncated version of Jasons text:
  678.  
  679.              COLOR DITHERING EXPERIMENTS with gdevstc-1.17
  680.              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  681.  
  682. Here is a summary of the results for the following four experiments...
  683.  
  684.  gsmono: What you'd expect from a mono ordered pattern. Like what a lot of
  685.          mono laser printers produce.
  686.  
  687.  fsmono: Excellent for monochrome.
  688.  
  689.  gscmyk: Not very good, but then you'd expect that from an ordered pattern.
  690.  
  691.  gsrgb:  A little better than gsrgb. More consistent looking.
  692.  
  693.  fs2:    Good, but not quite as good as fsrgb. Gets the brightness wrong,
  694.          too light at 720dpi, too dark at 360dpi.
  695.  
  696.  fsrgb:  Very good, but a little too dark and has a slight blue tint.
  697.  
  698.  hscmyk: Excellent. Slightly better than fsrgb and fs2. On some images, better
  699.          than fscmyk. On most, virtually the same.
  700.  
  701.  fscmyk: Excellent. Best. Very, *very* slightly better than hscmyk. Nearly as
  702.          good as the EPSON demos (which were done with the Windows driver).
  703.          ["nearly"? I believe 1.17 is better! G. Hess]
  704.  
  705.  
  706.  Overall Visual Quality (out of ten):
  707.  
  708.   gsmono |*********
  709.   fsmono |*****************
  710.   gscmyk |********
  711.   gsrgb  |*********
  712.   fs2    |****************
  713.   fsrgb  |*****************
  714.   hscmyk |******************
  715.   fscmyk |******************
  716.          +---------------------
  717.          0 1 2 3 4 5 6 7 8 9 10
  718.  
  719.  best-to-worst order:  color: fscmyk hscmyk fsrgb fs2 gsrgb gscmyk
  720.                         mono: fsmono gsmono
  721.  
  722. SANITY NOTE: The above results are only from *four* images, a total of 24
  723.              printouts (8 on 720dpi paper, 16 on plain paper). Your results
  724.              will almost certainly vary, and your standards might not be
  725.              the same as mine, so use these results as a *guide* only, not
  726.              as a formal evaluation.
  727.  
  728. F U T U R E - D E V E L O P M E N T
  729. ===================================
  730.  
  731. Hmm, my husband forces me to say that there will be no future development,
  732. but I think there is a fair chance for bug-fixing and for supplying a
  733. resonable color-adjustment.
  734.  
  735. Any suggestions, for instance support of the new printer-models, is
  736. welcome, provided that the one who suggests is willing to run some tests.
  737.  
  738.  
  739. C O L O R - T R A N S F O R M A T I O N
  740. =======================================
  741.  
  742. In the initial version of the driver, distributed with Ghostscript-3.33,
  743. the parameter "SpotSize" was the only way to manipulate the colors at the
  744. driver-level. According to the parameters enumerated above, this has changed
  745. significantly with version 1.16 and above. This is the result of
  746. an ongoing discussion about dithering-algorithms and "false color" on the
  747. Epson-Stylus-Color. This initiated the transformation of the stcolor-driver
  748. into a framework for different dithering-algorithms, that provides a generalized
  749. interface to the internal Ghostscript-Color-Models and the other data-structures
  750. related to Ghostscript-Drivers.
  751.  
  752. The main thing such a framework should be able to do is to deliver the
  753. values the dithering-algorithm needs and since this influences directly
  754. the optical image impression, this transformation should be adjustable without
  755. the need for recompilation and relinking.
  756.  
  757. In general the process can be described as follows:
  758.  
  759.    ColorAdjustMatrix   Coding                    Transfer
  760.  +---------------------+    +---------------------+    +------------------+
  761.  |  Ghostscript  Color |    | Ghostscript  Raster |    | Dithering  Data  |
  762.  |                     | => | 1/2/4/8/16/24/32Bit | => |   1/3/4x Values  |
  763.  |  1/3/4x16Bit Values |    | for all components  |    | (arbitrary type) |
  764.  +---------------------+    +---------------------+    +------------------+
  765.  
  766. Due to the limitations on raster-storage, information is lost in the first
  767. transformation step, except for the 16Bit Monochrome-Mode. So any color
  768. adjustment should take place before this step and this is where the optional
  769. ColorAdjustMatrix works.
  770.  
  771. The first transformation-step is called "coding" and is controlled by the
  772. ?coding-Arrays. The Decoding-process expands the range of values
  773. pontentially to a larger range than that provided by the initial ghostscript
  774. color-model. It is therefore a reasonable place to make device- and/or
  775. algorithm-specific adjustments. This is the place where the ?transfer-Arrays
  776. are used. Array-Access might be not the fastest method, but its generality
  777. is superior, so this step is always based upon internaly algorithm-specific
  778. array-access. If 8Bits are stored per color-component and if the algorithm
  779. uses bytes too, the second transformation is included within the first, what
  780. saves significant computation-time when printing the data.
  781.  
  782.  
  783. ColorAdjustMatrix
  784. -----------------
  785.  
  786. The driver supports different "ProcessColorModel"-Values, which raises the
  787. need for different color-adjustments. In the following "CAM" stands for
  788. ColorAdjustMatrix:
  789.  
  790.    DeviceGray: (3 Floats):
  791.       if((r == g) && (g == b))
  792.          K' = 1.0 - R;
  793.       else
  794.          K' = 1.0 - CAM[0] * R + CAM[1] * G + CAM[2] * B;
  795.  
  796.       According to the documentation in drivers.doc, the latter should
  797.       never happen.
  798.  
  799.    DeviceRGB: (9 Floats)
  800.       if((r == g) && (g == b))
  801.          R' = B' = G' = R;
  802.       else
  803.          R' = CAM[0]*R + CAM[1]*G + CAM[2]*B;
  804.          G' = CAM[3]*R + CAM[4]*G + CAM[5]*B;
  805.          B' = CAM[6]*R + CAM[7]*G + CAM[8]*B;
  806.  
  807.       The Printer uses always four inks, thus a special treatment of black
  808.       is provided. Algorithms may take special action, if r==g==b. Maybe
  809.       that in future versions Kcoding & Ktransfer become active in RGB-Mode.
  810.  
  811.    DeviceCMYK: (16 Floats)
  812.  
  813.       if((c == m) && (m == y))
  814.          K' = max(C,K);
  815.          C' = M' = Y' = 0;
  816.       else
  817.          K  = min(C,M,Y);
  818.          if((K > 0) && ColorAdjustMatrix_present) { => UCR
  819.             C -= K;
  820.             M -= K;
  821.             Y  -=K;
  822.          }
  823.  
  824.          C' = CAM[ 0]*C + CAM[ 1]*M + CAM[ 2]*Y + CAM[ 3]*K;
  825.          M' = CAM[ 4]*C + CAM[ 5]*M + CAM[ 6]*Y + CAM[ 7]*K;
  826.          Y' = CAM[ 8]*C + CAM[ 9]*M + CAM[10]*Y + CAM[11]*K;
  827.          K' = CAM[12]*C + CAM[13]*M + CAM[14]*Y + CAM[15]*K;
  828.  
  829.       Again we have a special black-treatment. "max(C,K)" was introduced
  830.       because of a slight misbehaviour of ghostscript, that delivers
  831.       black under certain circumstances as (1,1,1,0). Normally, when
  832.       no special "Black Seperation" and "Undercolor Removal" procedures
  833.       are defined at the postscript-level, either (c,m,y,0) or (0,0,0,k)
  834.       values are mapped. This would make the extended ColorAdjustMatrix
  835.       quite tedious, thus during mapping black-seperartion is done for
  836.       (c,m,y,0)-Requests and if there is a ColorAdjustMatrix, undercolor-
  837.       removal is used too. In other words the Default-Matrix is:
  838.  
  839.                    1 0 0 1
  840.                    0 1 0 1
  841.                    0 0 1 1
  842.                    0 0 0 1
  843.  
  844.        and it is applied to CMYK-Values with seperated and removed Black.
  845.        Raising the CMY-Coefficients while lowering the K-coefficients
  846.        reduces black and intensifies color. But be careful, even low
  847.        deviations from the default cause drastic changes.
  848.  
  849. If no ColorAdjustMatrix is set, the matrix-computations are skipped. Thus
  850. the transformation reduces to:
  851.  
  852.     - Range-Inversion in Monochrome-Mode
  853.     - Black-Separation in CMYK-Mode
  854.  
  855.  
  856. RGB/CMYK-coding & -transfer and BitsPerPixel
  857. --------------------------------------------
  858.  
  859. This two (groups) of parameters are arrays of floatingpoint-numbers in the
  860. range 0.0 to 1.0. They control the truncation to the desired number of
  861. bits stored in the raster-memory (BitsPerPixel) and the ink-density.
  862.  
  863. The "truncation" may become a nonlinear-function, if any of the ?coding-arrays
  864. are set. Assume the following Ghostscript invocation:
  865.  
  866.     gs -sDEVICE=stcolor -sDithering=fscmyk -dBitsPerPixel=16 \
  867.        -dMcoding='{ 0.0 0.09 0.9 1.0 }' \
  868.                                         -dYtransfer='{ 0.0 0.09 0.9 1.0 }' \
  869.        -dKcoding='{ 0.0 0.09 0.9 1.0 }' -dKtransfer='{ 0.0 0.09 0.9 1.0 }' \
  870.  
  871. We may have ?coding and/or ?transfer, thus four combinations are possible
  872. and this four combinations appear in the given example. The resulting mapping
  873. is given in the following tables, where except for the internal Indices
  874. (4 Components * 4 Bits = 16 BitsPerPixel), all values are normalized to the
  875. Range 0-1. The actual range is 0 to 65535 for the ghostscript-color and
  876. 0 to 16777215 (2^24-1) for the ink-values delivered to the fscmyk-algorithm.
  877. Sorry for the bunch of numbers following, but you may try this example in
  878. conjunction with "stcinfo.ps", what should give you a graphical
  879. printout of the following numbers, when you issue a "showpage"-command:
  880.  
  881.                             CYAN                      MAGENTA
  882.       CI/15 gs_color_values  CI    ink  gs_color_values  CI    ink
  883.       0.000   0.000 - 0.062   0  0.000   -0.123 - 0.123   0  0.000
  884.       0.067   0.063 - 0.125   1  0.067    0.123 - 0.299   1  0.247
  885.       0.133   0.125 - 0.187   2  0.133    0.299 - 0.365   2  0.351
  886.       0.200   0.188 - 0.250   3  0.200    0.365 - 0.392   3  0.379
  887.       0.267   0.250 - 0.312   4  0.267    0.392 - 0.420   4  0.406
  888.       0.333   0.313 - 0.375   5  0.333    0.420 - 0.447   5  0.433
  889.       0.400   0.375 - 0.437   6  0.400    0.447 - 0.475   6  0.461
  890.       0.467   0.438 - 0.500   7  0.467    0.475 - 0.502   7  0.488
  891.       0.533   0.500 - 0.562   8  0.533    0.502 - 0.529   8  0.516
  892.       0.600   0.563 - 0.625   9  0.600    0.529 - 0.557   9  0.543
  893.       0.667   0.625 - 0.687  10  0.667    0.557 - 0.584  10  0.571
  894.       0.733   0.688 - 0.750  11  0.733    0.584 - 0.612  11  0.598
  895.       0.800   0.750 - 0.812  12  0.800    0.612 - 0.639  12  0.626
  896.       0.867   0.813 - 0.875  13  0.867    0.639 - 0.715  13  0.653
  897.       0.933   0.875 - 0.937  14  0.933    0.715 - 0.889  14  0.778
  898.       1.000   0.938 - 1.000  15  1.000    0.889 - 1.111  15  1.000
  899.  
  900. The difference between Cyan and Magenta is the presence of a Coding-Array.
  901. The coding-process must map a range of color-values to each of the 16
  902. component-indices. If no coding-array is given, this is accomplished
  903. by a division with 4096 -equivalent to a right-shift by 12 Bits-. The
  904. final ink-density resides in the given interval and moves form the left to
  905. the right side from 0 to 15. In the Magenta-case, there is a coding array
  906. and the ink-value matches the center of the intervals. But the distribution
  907. of the mapped intervals follows the given Coding-Array and is nonlinear in
  908. the linear color-space of ghostscript.
  909.  
  910. Now let us take a look at the case with Transfer-Arrays:
  911.  
  912.                            YELLOW                      BLACK
  913.       CI/15 gs_color_values  CI    ink  gs_color_values  CI    ink
  914.       0.000   0.000 - 0.062   0  0.000     -0.123-0.123   0  0.000
  915.       0.067   0.063 - 0.125   1  0.018      0.123-0.299   1  0.067
  916.       0.133   0.125 - 0.187   2  0.036      0.299-0.365   2  0.133
  917.       0.200   0.188 - 0.250   3  0.054      0.365-0.392   3  0.200
  918.       0.267   0.250 - 0.312   4  0.072      0.392-0.420   4  0.267
  919.       0.333   0.313 - 0.375   5  0.090      0.420-0.447   5  0.333
  920.       0.400   0.375 - 0.437   6  0.252      0.447-0.475   6  0.400
  921.       0.467   0.438 - 0.500   7  0.414      0.475-0.502   7  0.467
  922.       0.533   0.500 - 0.562   8  0.576      0.502-0.529   8  0.533
  923.       0.600   0.563 - 0.625   9  0.738      0.529-0.557   9  0.600
  924.       0.667   0.625 - 0.687  10  0.900      0.557-0.584  10  0.667
  925.       0.733   0.688 - 0.750  11  0.920      0.584-0.612  11  0.733
  926.       0.800   0.750 - 0.812  12  0.940      0.612-0.639  12  0.800
  927.       0.867   0.813 - 0.875  13  0.960      0.639-0.715  13  0.867
  928.       0.933   0.875 - 0.937  14  0.980      0.715-0.889  14  0.933
  929.       1.000   0.938 - 1.000  15  1.000      0.889-1.111  15  1.000
  930.  
  931. Yellow uses a transfer-array. There is no linear correspondence between
  932. the color- and the ink-values. This correspondence is defined through the
  933. given array. In other words: the Transfer-arrays define a nonlinear
  934. ink-characteristic, what is exactly the same functionaltity, that
  935. Postscripts "(color)transfer"-function provides.
  936.  
  937. While in the case of Yellow, the intervals match the intervals used with Cyan,
  938. the inetervals used for Black match the Magenta-Intervals, but watch
  939. the corespondence between the CI/15-values and the Ink-Density for Black:
  940. This is a linear distribution in the Ink-domian.
  941.  
  942. Not a bad idea, I think. Consider the fs2-algorithm: It uses values in
  943. the range 0-255 (Bytes). If any transfer-array would be supplied alone,
  944. some of the 256 possible values would never be used and others will be
  945. used for adjacent intervals several times. Establishing an identical
  946. coding-array solves this problem, so that the full potential of the
  947. algorithm is utilized.
  948.  
  949. Another useful feature of the coding-arrays is, that they are internally
  950. normalized to the 0-1 Range. In the 720x720Dpi-Mode the transfer-arrays
  951. in stcolor.ps limit the Dot-Density to about 50%, thus this arrays end
  952. at 0.5 (respectively start at 0.5 in the RGB-case). Due to the automatic
  953. normalization this arrays can be used as coding-arrays too. But of course
  954. in the fs2-case mentioned above, values from 0-127 will never be deliverd
  955. to the algorithm, while values 128-255 are delivered for adjacent intervals.
  956.  
  957. To clearify the intended use of the three parameters/parameter-groups the
  958. following statements should be kept in mind:
  959.  
  960. - ColorAdjustMatrix is never used, when transferring gray-values. This
  961.   restricts it to what the name says: Adjustment of Colors e.g. the
  962.   correction for miscolored ink. Do not use it for staturation or
  963.   brightness-control.
  964.  
  965. - ?transfer-arrays control the values delivered to the driver, which in
  966.   turn controls the ink-quantity. This arrays should be used for control
  967.   of saturation and brightness. Maybe that a Postscript-Header for the
  968.   manipulation of brightness and so on will be provided with future
  969.   versions. In general this arrays are identical for all inks.
  970.   If they differ they provide a simpler scheme for color-correction,
  971.   which is not necessarily faster than the ColorAdjustMatrix.
  972.  
  973. - ?coding-arrays control the color-value-intervals mapped to
  974.   the internal color-indices.
  975.  
  976. P R I N T - M O D I
  977. ===================
  978.  
  979. The parameters "Unidirectional", "Microweave", "noWeave",
  980. "OutputCode", "Model" and the given resolution provide control over the
  981. data generated for the printer.
  982.  
  983. Unidirectional
  984. --------------
  985. Simply toggles the unidirectional-mode of the printer. Setting "Unidirectional"
  986. definitly decreases printing-speed, but may increase the quality. I use
  987. this for printing tranparencies, where fast head-movement could smear the ink.
  988.  
  989. Microweave, noWeave and OutputCode=deltarow
  990. -------------------------------------------
  991. The first are two Booleans, what immediatly tells, that 4 combinations are
  992. possible. Actually only three exist (if you don't count for deltarow):
  993.  
  994.      1. Softweave
  995.      2. Microweave
  996.      3. noWeave
  997.  
  998. First and second are functionally identical, their difference is that either
  999. the driver or the printer does the job. So the question
  1000.  
  1001.             What is weaving ?
  1002.  
  1003. arises. The Epson Stylus Color has a Head-Assembly that contains two physically
  1004. identifiable Heads. One for Black and one for Cyan/Magenta/Yellow. This
  1005. makes 4 logical Heads, one for each color-component. Each of this four heads
  1006. has several jets at some Y-distance, so several horizontal lines can be printed
  1007. during one pass of the heads. From the experience I think there are 15 Jets
  1008. per color spaced at 1/90".
  1009.  
  1010. So the question arises, how to print at a Y-Resolution of 360Dpi with this
  1011. 90DpI-Jets. Simply by divison, one gets 360/90 = 4, what tells us, that
  1012. 4 Passes of the head-assembly are required to achieve a Y-resolution of
  1013. 360DpI. Weaving is just the scheme how the 15 jets are utilized to print
  1014. adjacent horizontal rows:
  1015.  
  1016.                     Weaving                   noWeave
  1017.     Pass:     1     2     3     4       1     2     3     4
  1018.     0/360"   jet0   -     -     -      jet0   -     -     -
  1019.     1/360"    -    jet1   -     -       -    jet0   -     -
  1020.     2/360"    -     -    jet2   -       -     -    jet0   -
  1021.     3/360"    -     -     -    jet3     -     -     -    jet0
  1022.     4/360"   jet1   -     -     -      jet1   -     -     -
  1023.     5/360"    -    jet2   -     -       -    jet1   -     -
  1024.     6/360"    -     -    jet3   -       -     -    jet1   -
  1025.     ....
  1026.  
  1027. Now let us assume, that the dot-diameter is different for each individual
  1028. jet, but the average among the jets matches the desired resolution. With
  1029. weaving adjacent rows are printed by different jets, thus the some averaging
  1030. takes place. Without weaving adjacent rows are printed by the same jet and
  1031. this makes the dot-diameter-deviations visible as 1/90"-stripes in the printout.
  1032.  
  1033. In Softweave-Mode (the default) the driver sends the data properly arranged to
  1034. the printer, while in Microweave-Mode the printer does the same job. But in
  1035. general the host-processor is much faster than the printers processor and
  1036. thus it is advantageous to let the host do this job. In addition to that, for
  1037. 720DpI 8 Passes are required and the amount of buffer-space required to buffer
  1038. the data for the passes is far beyond the printers memory. SoftWeave requires
  1039. an odd value of "escp_Band", the Stylus Color provides 15 for that.
  1040.  
  1041. "OutputCode" controls the encoding used. In the basic modi, the choice consists
  1042. of "plain" and "runlength". The computation of runlength-encoded data does not
  1043. take much time, at least less than the datatranfer to the printer, thus this
  1044. is the recommended mode and of course the default. With the Stylus Color
  1045. Epson introduced some new encoding principles, namely "tiff" and "deltarow".
  1046. While the first was omitted from this driver, since there were not potential
  1047. advantages found, "deltarow" is available as an option. "Softweave" cannot
  1048. be used with this encoding, so if "OutputCode=deltarow" is set, Microweave
  1049. becomes the default. Maybe that the size of the ESC/P2-code becomes smaller,
  1050. but I have never observed increased printing-speed - things tend to become
  1051. slower with deltarow compared to Softweave.
  1052.  
  1053. Model
  1054. -----
  1055. Some ESC/P2-Printers, such as the Stylus 800, do not offer Microweave or
  1056. the commands required to do Softweave. Setting Model just changes the defaults
  1057. and ommits some parts of the initialization-sequence, which are not compatible
  1058. with the given printer model. Currently only "st800" is supported besides the
  1059. default (stcolor).
  1060.  
  1061.  
  1062. BEWARE: BUGS & PITFALLS
  1063. =======================
  1064.  
  1065. * The given ?coding and ?transfer arrays should be strictly monotonic.
  1066.  
  1067. * It is impossible to change WHITE: that's your paper.
  1068.   Thus R/G/B-transfer should end at 1.0 and C/M/Y/K-transfer should
  1069.   start at 0.0.
  1070.  
  1071. * Usually 8Bits per component yields fastest operation.
  1072.  
  1073. * The ColorAdjustMatrix is not used in the reverse-transformation, which
  1074.   is used, when Gostscript does the dithering (gs*-Modi). Expect funny
  1075.   results.
  1076.  
  1077. * If BitsPerPixel is less than 6, the entire coding/transfer-process
  1078.   does not work. This is always true for the gs*-modi and becomes true
  1079.   for the other modi, if BitsPerPixel is forced to low values.
  1080.  
  1081. * 720x720Dpi-Printing should never select the gs-modi and should always
  1082.   use stcolor.ps. (I prefer 360x720)
  1083.  
  1084. A D D I N G   D I T H E R I N G   A L G O R I T H M S
  1085. =====================================================
  1086.  
  1087. Access to the Ghostscript-sources is required to add a new dithering-algorithm.
  1088. The driver-source includes 9 Files:
  1089.  
  1090.     gdevstc.h    - common C-Header, including algorithm-declarartions
  1091.     gdevstc1.c   - "gsmono"-Algortihm
  1092.     gdevstc2.c   - fs-algorithms (access via "fsmono", "fsrgb", "fscmyk")
  1093.     gdevstc3.c   - "gsrgb"-Algorithm
  1094.     gdevstc4.c   - "fs2"-Algorithm
  1095.     gedevstc.c   - basic driver source + gscmyk & hscmyk
  1096.     stcolor.ps   - Postscript-header with ?transfer-Arrays
  1097.     stcinfo.ps   - Test-Page for the Printer
  1098.  
  1099. and requires modification of:
  1100.     devices.doc  - That's were this file goes to
  1101.     devs.mak     - device-specific Make-Rules
  1102.     unix-end.mak - to add the installation-rule for stcolor.ps
  1103.  
  1104. In Beta-versions of the driver this documentation resides in a
  1105. seperate file named "gdevstc.doc".
  1106.  
  1107. While all sources are required to build the driver, only gdevstc2.c and
  1108. gdevstc4.c contain real dithering-algorithms, the other three
  1109. "algorithm-sources" are considered to be templates to add new algorithms.
  1110.  
  1111. Besides writing the source, a modification in "gdevstc.h" is required
  1112. (search for "MODIFY HERE" and follow the instructions).
  1113.  
  1114. The Algorithm should be implemented as a single function, with the following
  1115. arguments:
  1116.  
  1117.    int stc_newalgo(                  /* or whatever you like */
  1118.       stcolor_device *sdev,          /* the device-structure */
  1119.       int     npixel,                /* Number of Bits/Pixels */
  1120.       byte   *in,                    /* pixel-values */
  1121.       byte   *buf,                   /* private buffer */
  1122.       byte   *out);                  /* one byte per pixel output */
  1123.  
  1124.    with "in" and "buf" being actually pointers to either "byte", "long" or
  1125.    "float" values.
  1126.  
  1127. The array "in" holds one item of the requested type (byte/long/float) per
  1128. color-component (1:K, 3: R G B, 4: C M Y K) for each pixel. Alternatively
  1129. the algorithm can request the internal ghostscript-scanline as input, by
  1130. setting the flag "STC_DIRECT". This saves memory and potentially time.
  1131. The driver-specific values can be found in
  1132.  
  1133.     ((byte/long/float *) (sdev->stc.vals[component]))[component-value]
  1134.  
  1135. by such direct-drivers. If a driver works on bytes in most cases the
  1136. driver-specific values are stored within the ghostscript-line what
  1137. implicitly includes "STC_DIRECT".
  1138.  
  1139. Obviously the routine should deliver output to the array of bytes named "out".
  1140. It holds one byte per pixel and values should be composed by or'ing
  1141. the constants
  1142.  
  1143.      DevciceGray -> BLACK
  1144.      DeviceRGB   -> RED GREEN BLUE
  1145.      DeviceCMYK  -> CYAN MAGENTA YELLOW BLACK
  1146.  
  1147. together (There is no "WHITE" defined, since it is different in RGB and
  1148. the other color-modes). The initial contents of "out" is the result of the
  1149. previous call to the routine. The routine should deliver 0 upon success.
  1150. negative values supress printing (only checked upon the initialization-call).
  1151.  
  1152. Besides the "normal" invocation, there are two special calls:
  1153.  
  1154.   Initialization: npixel holds the NEGATIVE number of pixels then.
  1155.       Initialization should initialize buf (out is already set to white)
  1156.       and check the parameters.
  1157.  
  1158.   White-Call: "in" is set to NULL then. This type of call must be
  1159.       requested by setting the flag "STC_WHITE".
  1160.  
  1161. There is another interesting Driver-Flag, named "STC_CMYK10". This is
  1162. useful only for CMYK-Drivers and yields 10Bit Component-Values. Thus
  1163. higher color-resolution is achieved. BitsPerPixel cannot be manipulated
  1164. with the CMYK10-Coding, it is fixed to 32. The coding is as follows:
  1165.  
  1166.    gx_color_index: aaaa aaaa aabb bbbb bbbb kkkk kkkk kktt
  1167.  
  1168.    the "tag" (tt) controls what colors are represented by "a" and "b":
  1169.        00 -> C = k, M = a, Y = b, K = k
  1170.        01 -> C = a, M = k, Y = b, K = k
  1171.        02 -> C = a, M = b, Y = k, K = k
  1172.        03 ->                      K = k, (gray-level)
  1173.  
  1174.    thus the value "(gx_color_index)" 3 represents white with this coding.
  1175.  
  1176. Another specificum with this CMYK10-Coding is, that the Ghostscript-Line
  1177. represents an array of "gx_color_index"-values and can be manipulated
  1178. as such. This saves reasonable processing-time for direct drivers.
  1179.  
  1180. Any "normal" CMYK-Driver defaults to CMYK10-Coding, if:
  1181.     1. It is not a DIRECT-Driver and
  1182.     2. The range of Values covers more than 8 Bits
  1183. Any setting of BitsPerPixel causes such a driver to fall back to the
  1184. normal CMYK-Mode.
  1185.  
  1186.  
  1187. T E S T S (version 1.13 and above)
  1188. ==================================
  1189.  
  1190. This section should give an overview over the performance in terms of
  1191. processing- & printing-time. Printing is done offline (via cp-instruction)
  1192. to measure real printing-speed, since at high-resolutions processing-time
  1193. is in the same order of magnitude and thus may become the limiting factor.
  1194.  
  1195. The various OutputCodes
  1196. -----------------------
  1197.  
  1198. I ran several files though ghostscript and recorded the size of the code,
  1199. the processing time and the printing-time, at least for some of the files.
  1200. Always the following options were used:
  1201.  
  1202.       "-sDEVICE=stcolor -sPAPERSIZE=a4 stcolor.ps - < file.ps"
  1203.  
  1204. (Actually "-sPAPERSIZE=a4" is in my gs_init.ps since I'm a germ.)
  1205.  
  1206. "Softweave" means actually, that nothing else was used, it is the default and
  1207. implies that odd v=40/h=10/m=15 mode (ESC . 1 40 10 15).
  1208.  
  1209. "Microweave" is just "-dMicroweave", which is equivalent to "ESC . 1 10 10 1",
  1210. with full skip-optimization and microweave-activated.
  1211.  
  1212. "deltarow" is the new encoding principle ("ESC . 3 10 10 1") with Microweave on.
  1213. It is activated with "-sOutputCode=deltarow".
  1214.  
  1215. Finally I wanted to see the plain Kathy Ireland and used "-sOutputCode=plain",
  1216. which is just replacing RLE by no encoding, thus "ESC . 0 40 10 15" is
  1217. used then.
  1218. (So sorry: Kathy was still blue dressed in front of the blue sea on a blue
  1219. air-cushion - nice to see but hard to dither)
  1220.  
  1221. So here are the results:
  1222.  
  1223.               golfer.ps    colorcir.ps      drawing.ps        brief.ps
  1224.  
  1225. deltarow   572751/48.180u 643374/41.690u  90142/46.180u/1:50 178563/49.350u/2:22
  1226. Softweave  559593/46.810u 669966/44.960u 296168/48.160u/1:30 269808/43.320u/1:55
  1227. Microweave 590999/56.060u 754276/42.890u 338885/47.060u/1:50 282314/44.690u/2:22
  1228.  
  1229.                kathy.ps
  1230. deltarow   3975334/111.940u/5:35
  1231. Softweave  3897112/101.940u/3:10
  1232. Microweave 4062829/100.990u/3:15
  1233. plain/soft 5072255/104.390u/3:05
  1234.  
  1235. Evaluation:
  1236.  
  1237. A.) Might be, that I've not choosen the optimal deltarow-code, but even if
  1238.     it saves at lot of bytes, printing-speed is not increased.
  1239.  
  1240. B.) At least the printer prefers plain-kathy. In other words: Sending a
  1241.     1 Megabyte or 20% more data, has no impact on printing speed.
  1242.     [drawing.ps is an exception to this rule: plain prints slower than rle]
  1243.  
  1244. C.) But "unclever" coding -especially with deltarow- can significantly
  1245.     slows down printing. But even if very significant advantages in the
  1246.     size of the code ar achieved, "deltarow" is not competitive.
  1247.     [colorcir.ps shows savings in deltarow, but printing is a mess.]
  1248.  
  1249.  
  1250. Printing-Time related to other options
  1251. --------------------------------------
  1252.  
  1253. Full page halftone images printed, unless otherwise noted.
  1254.  
  1255.   DpI      print-mode    Size   Time comments
  1256. 180x180 mono      -/uni  358KB  1:15
  1257.                   -/bi   358KB  0:45
  1258.               micro/bi   205KB  0:45 (not weaving)
  1259.                soft/bi   179KB  1:25
  1260.         color     -/bi   641KB  2:45
  1261.                soft/bi   556KB  1:32
  1262.  
  1263. 360x360 mono      -/uni  269KB  0:50 (b/w Text)
  1264.                   -/bi   269KB  0:35 (b/w Text)
  1265.               micro/bi   269KB  2:25 (b/w Text)
  1266.                soft/uni  250KB  3:15 (b/w Text)
  1267.                soft/bi   250KB  1:55 (b/w Text)
  1268.         color     -/bi   346KB  1:00 (sparse color-page, visible displacements)
  1269.               micro/bi   346KB  1:50 (sparse color-page, looks buggy - printer?)
  1270.                soft/bi   294KB  1:30 (sparse color-page, O.K.)
  1271.                   -/bi  2218KB  2:45 (visible stripes)
  1272.               micro/bi  5171KB  3:17
  1273.                soft/bi  3675KB  3:05
  1274.  
  1275. 360x720 mono   soft/bi  2761KB  5:40
  1276.         color  soft/bi  7789KB  6:15 (just a small difference!)
  1277.  
  1278. 720x360 color  soft/bi  7182KB  5:40
  1279.  
  1280. 720x720 color micro/bi 14748KB 30:26 (actually beyond printers capabilities)
  1281.                soft/bi 14407KB 11:08
  1282.  
  1283.  
  1284. Processing-Time
  1285. ---------------
  1286. This table is generated on a 16MB i486/DX2 running under Linux, it is
  1287. extended for each version of the driver. User- (u) and System-Time (s)
  1288. is given seperately in seconds. Besides the files distributed with
  1289. ghostscript, the following inputs are used:
  1290.  
  1291.     tropics.ps:  6MB-Filesize, 1152x900x24 RGB-Image. (entire page covered)
  1292.     brief.ps:    Full-Text-Page (TeX-fonts) with some Logos. (125K)
  1293.     drawing.ps:  Sparse technical drawing, about 800K-Filesize
  1294.     kathy.ps:    2MB 640x480x24 Color-Image. (entire page covered)
  1295.     january.ps:  Processing of a 100K JPEG-File
  1296.  
  1297.  
  1298.  DpI    BPP Selected Modi       File                               i486DX2-CPU-Times
  1299.                                                1.12/1.13         1.16             1.17             1.20
  1300.  
  1301. 180x180  8  fsmono,noWeave,Uni  tropics.ps  110.79u   2.94s  117.16u  3.11s  119.96u  3.01s  121.12u  2.89s
  1302. 180x180  8  fsmono,noWeave      tropics.ps  112.68u   3.44s  132.85u? 3.19s  120.22u  2.95s  123.76u  2.87s
  1303. 180x180  1  gsmono,Microweave   tropics.ps  119.74u   2.83s  120.95u  2.64s  124.56u  3.01s  121.32u  3.02s
  1304. 180x180  1  gsmono              tropics.ps  119.27u   2.71s  120.11u  2.97s  124.36u  2.95s  122.76u  2.65s
  1305. 180x180  4  gsrgb,noWeave       tropics.ps  230.26u   3.01s  287.15u  2.85s  276.06u  3.27s  289.05u  2.74s
  1306. 180x180  4  gscmyk [DEFAULT]    tropics.ps (231.63u   2.93s) 398.10u  3.11s  394.02u  3.39s  413.78u  2.79s
  1307.  
  1308. 360x360  1  gsmono,noWeave,Uni  brief.ps      8.64u   0.63s   23.75u  1.01s   28.28u  1.20s  27.48u   0.79s
  1309. 360x360  8  fsmono,noWeave      brief.ps     16.76u   0.83s   41.93u  1.29s   43.74u  1.16s  41.30u   1.06s
  1310. 360x360  4  gsrgb,Microweave    brief.ps     22.45u   1.22s   47.18u  1.33s   46.83u  1.41s  46.67u   1.20s
  1311. 360x360  4  gscmyk              brief.ps    ---.--u  --.--s   23.050  1.20s   23.22u  1.27s  23.33u   1.29s
  1312. 360x360 24  fsrgb,Uni,Flag0     brief.ps     44.67u   1.04s   57.95u  1.38s   60.11u  1.23s  60.15u   1.16s
  1313. 360x360 24  fs2                 brief.ps    ---.--u  --.--s   97.75u  1.20s   97.94u  1.17s  99.96u   1.10s
  1314. 360x360 30  fsrgb               brief.ps    ---.--u  --.--s   85.67u  1.32s   85.42u  1.13s  87.09u   2.25s
  1315.             (creates colors instead of grays due to random initialization)
  1316. 360x360 32  hscmyk              brief.ps     63.07u   0.83s   74.90u  1.42s   40.16u! 1.33s  45.13u   1.54s
  1317.  
  1318. 360x360  4  gscmyk,noWeave      drawing.ps   27.61u   1.27s   24.71u  1.34s   25.89u  1.62s  24.88u   1.74s
  1319. 360x360 24  fsrgb,Microweave    drawing.ps   52.70u   1.33s   60.21u  1.53s   60.78u  1.29s  62.69u   1.52s
  1320. 360x360 32  hscmyk              drawing.ps   67.75u   1.22s   71.62u  1.40s   43.70u  2.12s  51.99u   2.05s
  1321. 360x360 32  hscmyk,escp_Band=29 drawing.ps  ---.--u  --.--s   71.25u  1.62s   42.61u  1.84s  48.89u   1.98s
  1322.  
  1323. 360x360  4  gscmyk,noWeave      tropics.ps (261.34u   4.99s) 429.73u  4.58s  437.40u  4.31s 445.25u   4.46s
  1324. 360x360  4  gsrgb,noWeave       tropics.ps  261.34u   4.99s  342.71u  4.54s  347.41u  5.11s 349.88u   4.41s
  1325. 360x360 24  fsrgb,Microweave    tropics.ps  206.11u  17.81s  216.42u 13.55s  210.40u 13.01s 218.61u  13.14s
  1326. 360x360 24  fs2                 tropics.ps  ---.--u  --.--s  313.64u 12.27s  320.42u 12.17s 325.77u  12.65s
  1327. 360x360 32  fscmyk              tropics.ps  ---.--u  --.--s  ---.--u --.--s  262.29u 14.08s 268.47u  14.57s
  1328. 360x360 32  hscmyk              tropics.ps  206.67u  18.31s  272.93u 16.90s  224.88u 16.55s 239.12u  16.49s
  1329.  
  1330. 360x720  8  fsmono              tropics.ps  164.69u  15.15s  239.77u 10.31s  240.37u  8.41s 236.25u   9.04s
  1331. 360x720 16  fsmono              tropics.ps  ---.--u  --.--s  400.94u 26.56s  252.86u 11.82s 247.62u   9.92s
  1332. 360x720 24  fsrgb               tropics.ps  277.30u  22.40s  303.76u 16.55s  304.46u 16.42s 314.24u  16.02s
  1333. 360x720 32  hscmyk              tropics.ps  307.70u  21.68s  388.35u 17.11s  297.32u 17.73s 306.50u  17.54s
  1334.  
  1335. 720x360 32  hscmyk              tropics.ps  299.99u  21.82s  381.58u 17.35s  311.28u 17.70s 525.60u  33.640s?
  1336.  
  1337. 720x720  8  fsmono              tropics.ps  199.06u  18.87s  334.23u 11.60s  333.80u 11.14s 325.19u  11.03s
  1338. 720x720 24  fsrgb               tropics.ps  399.96u  35.99s  461.07u 23.85s  454.11u 22.71s 446.52u  23.78s
  1339. 720x720 32  hscmyk              tropics.ps  473.13u  33.07s  587.53u 25.38s  440.83u 26.02s 429.84u  26.52s
  1340. 720x720 32  hscmyk,Microweave   tropics.ps  506.10u  33.59s  622.07u 27.71s  437.17u 28.27s 420.25u  26.80s
  1341. 720x720 32  hscmyk,Microweave   escher.ps                    394.59u  7.85s  223.89u  9.28s 230.01u   6.99s
  1342.  
  1343. 180x90   1  gsmono,noWeave,Uni  golfer.ps     2.00u   0.45s    6.72u  1.14s    5.30u  0.82s   5.10u   0.69s
  1344. 180x180  8  fsmono,Microweave   golfer.ps     6.09u   0.83s   17.21u  2.22s   13.67u  0.95s  13.33u   0.74s
  1345. 180x360  4  gscmyk              escher.ps     ---FAILED!---   48.42u 14.10s   38.32u  1.26s  37.98u   1.25s
  1346. 180x720 24  fsrgb               colorcir.ps  47.25u   5.24s   62.22u  1.30s   53.78u  1.66s  59.05u   0.94s
  1347. 180x180  8  fsmono,noWeave      kathy.ps     35.56u   3.48s   45.00u  1.39s   43.91u  1.72s  46.32u   1.38s
  1348. 360x90   8  fsmono,noWeave      golfer.ps     5.84u   1.08s   14.01u  0.72s   13.56u  0.70s  13.21u   0.70s
  1349. 360x180  8  fsmono,Microweave   golfer.ps    10.13u   1.92s   25.98u  1.30s   24.84u  1.22s  24.33u   1.13s
  1350. 360x360 24  fsrgb,Microweave    kathy.ps    105.98u  15.53s  116.18u  4.46s  122.57u  5.09s 115.18u   5.21s
  1351. 360x360 30  fsrgb               kathy.ps    ---.--u  --.--s  165.05u  5.26s  164.99u  5.89s 166.70u   5.92s
  1352. 360x720 24  fsrgb               colorcir.ps  91.27u  11.91s  118.96u  2.43s  116.27u  2.53s 105.30u   2.23s
  1353. 360x720 32  hscmyk              colorcir.ps 128.90u  10.43s  140.37u  1.59s   67.43u  1.87s  81.52u   1.60s
  1354. 720x90   8  fsmono,noWeave      golfer.ps    10.64u   2.59s   26.39u  1.22s   29.15u  1.67s  24.54u   1.28s
  1355. 720x180 24  fsrgb               escher.ps    73.60u  10.83s   82.49u  2.31s   78.12u  2.52s  81.84u   2.32s
  1356. 720x360 24  fsrgb               kathy.ps    179.66u  29.56s  205.95u  7.94s  197.64u  8.29s 201.46u   8.14s
  1357. 720x360 32  hscmyk              kathy.ps    227.41u  34.00s  273.93u  8.23s  175.54u  8.50s 175.32u   8.36s
  1358. 720x360 32  hscmyk              january.ps                   293.76u  9.67s  163.49u  9.51s 172.33u  10.12s
  1359. 720x720 32  hscmyk              january.ps                                   295.64u 13.33s 316.55u  12.98s
  1360.  
  1361. ### ------------------------------ End --------------------------------- ###
  1362.  
  1363. ### --------------- The BJC-600/BJC-800/BJC-4000 printers -------------- ###
  1364.  
  1365. This section was written by Yves Arrouye <Yves.Arrouye@imag.fr>.
  1366.  
  1367.  
  1368. HISTORY
  1369. -------
  1370.  
  1371. The BJC-600 driver was written in the first place by Yoshio Kuniyoshi
  1372. <yoshio@nak.math.keio.ac.jp> and later modified by me, Yves Arrouye
  1373. <Yves.Arrouye@imag.fr>. We both tried to make it evolve synchronously,
  1374. though Yoshio cannot be reached since a long time.
  1375.  
  1376. The drivers are based on code for the HP printers by George Cameron
  1377. <g.cameron@biomed.abdn.ac.ukis> (in fact, they are in the same file!),
  1378. so he's the first person to thank!
  1379.  
  1380. The 2.00 version of the drivers was a complete rewrite of the driver
  1381. (arguments, optimization, colour handling, in short: everything!) by
  1382. Yves Arrouye. The 2.x release is also the first one to be able to
  1383. use the full width of an A3 paper size...
  1384.  
  1385.  
  1386. VERSION INFORMATION
  1387. -------------------
  1388.  
  1389. The BJC-600 driver is version 2.13.11 dated 09/23/95.
  1390. The BJC-800 driver is version 2.13.03 dated 09/23/95.
  1391.  
  1392.  
  1393. COMPILATION NOTES
  1394. -----------------
  1395.  
  1396. Configuration
  1397. -------------
  1398.  
  1399. * Default values for options and other stuff
  1400.  
  1401. Configuration for the drivers can be made by modifying defauts values
  1402. in the file gdevbjc.h or on the compilation line. If you don't do
  1403. that, the drivers use reasonable defaults that make them work "as
  1404. expected".
  1405.   All default values given below are defined in this file if you need
  1406. to change them to customize your installation (a bad idea, better use
  1407. options...).
  1408.  
  1409. * CMYK to RGB color conversion
  1410.  
  1411. By default, the drivers use the same algorithm as Ghostscript to
  1412. convert CMYK colors to RGB. If you prefer to use Adobe formulas,
  1413. define USE_ADOBE_CMYK_RGB when compiling. (See the top of the
  1414. gdevcdj.c file to see the difference between the two.)
  1415.  
  1416. * Vertical centering of the printable area
  1417.  
  1418. The drivers center the imageable area horizontally, but no vertically
  1419. so that what can be printed does use the most of the output media. If
  1420. you define BJC_DEFAULT_CENTEREDAREA when compiling, then the top and
  1421. bottom margins will be the same, resulting in a vertically centered
  1422. imageable area too.
  1423.  
  1424. * Margins
  1425.  
  1426. If you define USE_RECOMMENDED_MARGINS then the top and bottom margins
  1427. will be se same (i.e. BJC_DEFAULT_CENTEREDAREA will be defined for
  1428. you) and these margins will be those recommended by Canon, 12.4 mm.
  1429.   Because margins are a complicated thing (due to the fact that one
  1430. does rely on the mechanical precision of the printer), the drivers do
  1431. something about the bottom margin: by default the bottom margin is
  1432. 9.54 mm for the bjc600 driver and 7 mm for the bjc800 one. If you
  1433. define USE_TIGHT_MARGINS then the bottom margin is 7 mm for both
  1434. drivers (but I never managed to get my own bjc600 print a line on this
  1435. low bound, hence the greater default). Regardless of the presence of
  1436. this define, USE_FIXED_MARGINS will not allow the bjc800 to use the
  1437. lower 7 mm bottom margin, so if you have a problem with the bottom
  1438. margin on a bjc800, just define that (without defining USE_TIGHT_MARGINS,
  1439. of course).
  1440.  
  1441. Compilation
  1442. -----------
  1443.  
  1444. Make sure the bjc600 and/or bjc800 devices are in your DEVICE_DEVS
  1445. variable. That is look in the makefile for your platform and add them
  1446. if necessary. This means for example adding them to the DEVICE_DEVS6
  1447. variable. The line should read something like that:
  1448.  
  1449.     DEVICE_DEVS6=bj10e.dev bj200.dev bjc600.dev bjc800.dev
  1450.  
  1451. Now if you get an error from make saying that it does not know how to
  1452. make bjc800.dev it's because you have an old makefile with only the
  1453. bjc600 device in it. You then have to copy the lines explaining how to
  1454. make bjc800.dev in your makefile. These lines are in devs.mak (under
  1455. the lines for making bjc600.dev) and should go just after the lines
  1456. for making bjc600.dev.
  1457.  
  1458. Testing the margins
  1459. -------------------
  1460.  
  1461. A quick way to be sure that the margins you selected (see above) are
  1462. okay is to print a file whose contents are:
  1463.  
  1464.       %!
  1465.       clippath stroke showpage
  1466.  
  1467. If the margins are okay, you will obtain a rectangle surrounding the
  1468. printable area.
  1469.  
  1470. USE OF THE DRIVERS
  1471. ------------------
  1472.  
  1473. There are two drivers here: the "bjc600" one supports the BJC-600 and
  1474. BJC-4000 (maybe the BJC-70 as well) and the "bjc800" one supports the
  1475. BJC-800 series. When remarks here apply to both drivers, the name
  1476. "bjc" will be used.
  1477.  
  1478. Supported Options and Defaults
  1479. ------------------------------
  1480.  
  1481. (Note: the names "options", "properties" and "parameters" will be used
  1482. to designate the same thing: device parameters that you can change
  1483. from gs.)
  1484.  
  1485. Preamble: if an option is given an incorrect value, an error will
  1486. occur. Unless stated otherwise, this error will be a rangecheckerror.
  1487.   Options may be set from the gs command-line (using the -d and -s
  1488. switches or other predetermined switches if they have an effect on the
  1489. driver) or using the setpagedevice Level 2 operator if Ghostscript has
  1490. been compiled with the level2 device (it should ;-)). There are *no*
  1491. special-purpose operators as one was able to find in Level 1 printers.
  1492.  
  1493. The default number of bits per pixel for the bjc is 24 (unless you
  1494. change the value of BJC_BITSPERPIXEL) and corresponds to a CMYK
  1495. printing. Supported modes are 1 bpp and 4 bpp (gray levels), 8 bpp, 16
  1496. bpp, 24 bpp and 32 bpp (colours). Colours are preferrably stored in
  1497. the CMYK model (which means that with 16 bpp there are only 16
  1498. different shades of each color, for example) but it is possible to
  1499. store them as RGB color for some depths.
  1500.   Some modes do Floyd-Steinberg dithering while some others don't and
  1501. use the default Ghostscript halftoning (in fact, when halftoning is used
  1502. dithering takes also place but due to the low resolutions it is
  1503. usually not eficient and thus invisible).
  1504.  
  1505. Here is a short description of each printing mode (expressed in
  1506. bpp/colors):
  1507.  
  1508.   32/4  CMYK Colour printing, Floyd-Steinberg dithering.
  1509.   24/4    Id. (But each primary colour is stored on 6 bits instead of 8.)
  1510.  
  1511.   24/3  RGB colour printing, Floyd-Steinberg dithering. This mode will
  1512.         *not* use the black cartridge (that's why it exists, for when you
  1513.         don't want to use it ;-)). Each primary colour is stored on 8
  1514.         bits (we have only three colours here, okay?). (Of course, with
  1515.     this mode you'll get brownish/pinkish output; it will remind you
  1516.     the first versions of the driver....). This mode is not supported
  1517.     anymore.
  1518.  
  1519.   16/4  CMYK colour printing, halftoned by Ghostscript. FS dithering
  1520.         is still visible here (but the halftone patterns are visible
  1521.         too!).
  1522.  
  1523.   8/4    Id. (But each primary colour is stored on 2 bits instead of 4.)
  1524.  
  1525.   8/1    Gray-levels printing, Floyd-Steinberg dithering.
  1526.  
  1527.   3/3   RGB colour printing. This mode is not intended to be
  1528.         used. What I mean is that it should be used only if you 
  1529.     want to use custom halftone screens *and* the halftoning is
  1530.     broken using the 8/4 mode (some versions of gs have a
  1531.     problem).
  1532.  
  1533.   1/1    Gray-levels printing, halftoned by GhostScript.
  1534.  
  1535. These modes are selected using the BitsPerPixel *and* Colors integers
  1536. options (either from the command line or in a PostScript program using
  1537. setpagedevice). See below.
  1538.  
  1539. A note about darkness of what is printed: Canon printers do print dark,
  1540. really. And the Floyd-Steinberg dithering may eventually darken your image
  1541. too. So you may need to apply gamma correction by calling gs as in
  1542.  
  1543.   % gs -sDEVICE=bjc600 gamma.ps myfile.ps
  1544.  
  1545. where gamma.ps changes the gamma correction (here to 3 for all colors):
  1546.  
  1547.   { 0.333 exp } dup dup currenttransfer setcolortransfer
  1548.  
  1549. The drivers support printing at 90 dpi, 180 dpi and 360 dpi. Horizontal and
  1550. vertical resolutions must be the same or a limitcheck error will happen. A
  1551. rangecheck will happen too if the resolution is not 90 * 2**n. (If the
  1552. driver is compiled with -DBJC_STRICT a rangecheck will also happen if
  1553. the resolution is not one of those supported. This is not the case as we
  1554. expect that there may be a 720 dpi bjc someday).
  1555.  
  1556. Here are the various options supported by the bjc drivers, along with
  1557. their type, supported values, effect(s) and usage:
  1558.  
  1559.   BitsPerPixel (int)    Choose the depth of the page. Valid values are
  1560.             1, 8, 16, 24 and 32. Default is 24.
  1561.               Note that when this is set for the first
  1562.             time, the Colors property is automatically
  1563.             adjusted unless it is also specified. Defaults
  1564.             adjustments are show in the table below,
  1565.             default choices are indicated by a star (*).
  1566.               This table gives also the corresponding
  1567.             color models and the rendering method that is
  1568.             visible (GS means Ghostscript halftoning, FS
  1569.             Floyd-Steinberg dithering, and if both are
  1570.             present it means that the dithering of
  1571.             halftones is visible).
  1572.  
  1573.             +-----+--------+---+----------+-------+
  1574.             | Bpp | Colors | * | C. Model | Dith. |
  1575.             +-----+--------+---+----------+-------+
  1576.             |  32 |      4 |   | CMYK     |    FS |
  1577.             +-----+--------+---+----------+-------+
  1578.             |  24 |      4 | * | CMYK     |    FS |
  1579.             |     |      3 |   | RGB      |    FS |
  1580.             +-----+--------+---+----------+-------+
  1581.             |  16 |      4 |   | CMYK     | GS FS |
  1582.             +-----+--------+---+----------+-------+
  1583.             |   8 |      4 | * | CMYK     | GS    |
  1584.             |     |      1 |   | K (CMYK) |    FS |
  1585.             +-----+--------+---+----------+-------+
  1586.             |   3 |      3 | * | RGB      | GS    |
  1587.             +-----+--------+---+----------+-------+
  1588.             |   1 |      4 |   | K (CMYK) | GS    |
  1589.             |     |      3 |   | K (RGB)  | GS    |
  1590.             |     |      1 | * | K (CMYK) | GS    |
  1591.             +-----+--------+---+----------+-------+
  1592.  
  1593.                 Valid Colors values for allowed
  1594.                      BitsPerPixel values.
  1595.  
  1596.               Also note that automagical change of one
  1597.             parameter depending on the other one does not
  1598.             work in a setpagedevice call. This means that
  1599.             if you want to change BitsPerPixel to a value
  1600.             whose valid Colors values do not include the
  1601.             actual Colors value, you must change Colors
  1602.             too.
  1603.  
  1604.   HWResolution (floats array)  
  1605.             An array of 2 floats giving the horizontal and
  1606.             vertical resolution in dots per inch. Supported
  1607.             values are 90, 180 and 360 and both values
  1608.             must be the same. Default is 360.
  1609.               (On the gs command line, the resolution is
  1610.             changed by saying "-rXDPIxYDPI".)
  1611.  
  1612.   ManualFeed (bool)    Indicate that the sheets won't be fed automatically
  1613.             by the printer. Default is false.
  1614.               (Not meaningful on the BJC-600, I fear.)
  1615.  
  1616.   MediaType (string)    Choose the media to print on. Values are chose
  1617.             amongst "PlainPaper", "CoatedPaper",
  1618.             "TransparencyFilm", "Envelope", "Card" and "Other".
  1619.             Default is "PlainPaper".
  1620.               If the chose media is "Envelope", "Card" or
  1621.             "Other", the driver will make the printer go
  1622.             in thick mode automatically regardless of the
  1623.             media weight.
  1624.  
  1625.   MediaWeight (int or null)
  1626.             Choose the weight of the media (in g/m2). Using
  1627.             null indicates that the weight is of no
  1628.                         importance. Default is null.
  1629.               If the specified media weight is greater
  1630.             than 105 (i.e. the value of the compilation 
  1631.                         default BJC???_MEDIAWEIGHT_THICKLIMIT) then
  1632.             the printer will be setup to use thick paper.
  1633.  
  1634.   PrintQuality (string) Choose the quality of printing. For the bjc600
  1635.             driver it can be one of "Normal", "High" and
  1636.             "Draft". For the bjc800 driver it can be one
  1637.             of "Low", "Normal", "High" and "Draft".
  1638.             Default is "Normal" for both drivers.
  1639.               For both drivers, "High" means 200% black and
  1640.             100% cyan, magenta and yellow (on a bjc600 you
  1641.             will get the "Bk+" light).
  1642.               For the bjc600 driver, "Normal" lits the
  1643.             "HQ" light while "Draft" unlits it.
  1644.               For the bjc800 driver, "Low" has the effect
  1645.             of making only two printing passes instead of
  1646.             four (should be twice as fast ;-)). This is
  1647.             what is known as "CN" (Color Normal) mode.
  1648.  
  1649.   PrintColors (int)    Mask for printing color. If 0, use black for
  1650.             any color.
  1651.               Otherwise, the value must be the sum of any
  1652.                 of 1 (cyan), 2 (magenta), 4 (yellow) and 8
  1653.             (black), indicating which colors will be used
  1654.             for printing.
  1655.               When printing colour, only those colour
  1656.             specified will be printed (this means that
  1657.             some planes will be missing).
  1658.               When printing grays, black is used if it is
  1659.             present in the PrintColors; otherwise, the
  1660.             data is printed by superimposing each
  1661.             requested color.
  1662.             
  1663.   MonochromePrint (bool)
  1664.             *For bjc600 only*. Substitute black for Cyan,
  1665.             Magenta and Yellow when printing (useful for
  1666.             getting some monochrome output of a dithered
  1667.             printing for example). Default is false.
  1668.               This is a hardware mechanism as opposed to
  1669.             the previous software one. I think that using
  1670.             this or setting PrintColors to 0 will give the
  1671.             same results.
  1672.  
  1673. Note that the MediaType and ThickMedia options will be replaced by the use
  1674. of the device InputAttributes and OutputAttributes as soon as possible.
  1675.  
  1676. Please note too that the print mode may be reset at the start of a print,
  1677. not at the end. This is the expected behaviour. If you need to reset
  1678. the printer to its default state, simply print a file that does just a
  1679. showpage.
  1680.  
  1681. Device Informations
  1682. -------------------
  1683.  
  1684. Here are other informations published by the driver that you will find
  1685. in the deviceinfo dictionary:
  1686.  
  1687.   OutputFaceUp (bool)   This has the boolean value true, indicating that
  1688.             the sheets are stacked face up.
  1689.  
  1690.   Version (float)    In the form M.mmpp where M is the major version,
  1691.             mm the bjc drivers minor version and pp the specific
  1692.             driver minor version (that is, M.mm will always be
  1693.             the same for the bjc600 and bjc800 drivers).
  1694.  
  1695.   VersionString (string)
  1696.             A string that gives the version info plus
  1697.             other indications. At the moment, things like
  1698.             'a' or 'b' may follow the version to indicate
  1699.             alpha or beta versions and the date of the
  1700.             last change to this version is given in the
  1701.             form MM/DD/YY (no,  it won't adapt to your
  1702.             locale!).
  1703.  
  1704. Hardware Margins
  1705. ----------------
  1706.  
  1707. The BJC printers have top and bottom hardware margins of 3 mm and 7.1
  1708. mm respectively (Canon says 7 mm but this is not usable because of
  1709. the rounding of paper sizes to PostScript points).. The left margin is
  1710. 3.4 mm for A4 and smaller paper sizes, 6.4 mm for US paper sizes,
  1711. envelopes and cards. It is 4.0 mm for A3 paper on the BJC-800.
  1712.  
  1713. The maximum printing width of a BJC-600 printer is 203 mm, in any event.
  1714. The maximum printing width of a BJC-800 printer is 289 mm on A3 paper,
  1715. and 203 mm on letter and A4 paper.
  1716.  
  1717. Reporting Problems
  1718. ------------------
  1719.  
  1720. When you report a problem please be as descriptive as possible, and
  1721. please send information that can be used to reproduce the problem.
  1722.   Please don't forget to tell me which driver you use and its
  1723. version. Version information can be found in this file or preferrably
  1724. by issuing the following command in a shell:
  1725.  
  1726.     % echo "currentpagedevice /VersionString get ==" \
  1727.         gs -q -sDEVICE=bjc600 -
  1728.  
  1729. (the % doesn't cound as part of the command and the device name should
  1730. be the device you really use).
  1731.  
  1732. Contact Address
  1733. ---------------
  1734.  
  1735. If you have problems with this driver (or if you are extremely
  1736. satisfied with it) you may email me at Yves.Arrouye@imag.fr.
  1737.   I consider reusing the "SpotSize" option of the Stylus driver (see
  1738. documentation above). I won't do it unless someone ask (with a good
  1739. reason), so if you need it, email me...
  1740.  
  1741. Acknowledgements
  1742. ----------------
  1743.  
  1744. I am particularly grateful to Yoshio Kuniyoshi <yoshio@nak.math.keio.ac.jp>
  1745. without whom I'd never make these drivers and also to Peter L. Deutsch
  1746. <ghost@aladdin.com> who answered *all* my (often silly) questions about
  1747. the drivers interface used by Ghostscript.
  1748.   Thanks also to the people who volunteered to beta-test the v2.x
  1749. BJC drivers; David Gaudine <david@donald.concordia.ca>, Robert M. Kenney
  1750. <rmk@unh.edu>, James McPherson <jmcphers@attila.stevens-tech.edu> and
  1751. Ian Thurlbeck <ian@stams.strath.ac.uk> (in an alphabetic listing) were
  1752. particularly helpful by discovering bugs and helping find out exact
  1753. paper margins on printers I don't have access to.
  1754.  
  1755. ### ------------------------------ End --------------------------------- ###
  1756.